
#ifndef TNODE_H
#define TNODE_H

#include "type.h"
#include <iostream>
#include <vector>
using namespace std;

class TNode
{
public:
	TNode();
	TNode(TYPE, int);
	void create(TYPE, int);
	TYPE getType();
	vector<TNode> getChild();
	void setChild(TNode);
	TNode* getParent();
	void setParent(TNode);
	int getIndex();
	void setIndex(int);
	bool isEqual(TNode);
	void toString();
	void toString(int);

private:
	//TYPE is an enum defined in type.h
	vector<TNode> children;
	TNode* parent;
	TYPE type;
	//index is only valid for some TYPE to represent their index in their respective table
	/* List of TYPE and what their index represents
			PROC procIndex
			STMTLST
			STMT stmt#?
			ASSIGN
			WHILE
			VAR varConstIndex
			CONST varConstIndex
			PLUS
			//NOT IN THIS ITERATION
			CALL
			IF
			PROGLINE
			MINUS
			TIMES

			SELECT
			SYNONYM defIndex
			WILDCARD
			BOOLEAN
			SUCHTHAT
			PATTERN
			EXPR
			WITH
			FOLLOWS
			FOLLOWST
			PARENT
			PARENTT
			MODIFIESS
			USESS
			//NOT IN THIS ITERATION
			MODIFIESP, USESP, NEXT, NEXTT, AFFECTS, AFFECTST, CALLS, CALLST
	*/
	int index;
};

#endif